package com.topway.ws.servlet;

import javax.servlet.ServletConfig;
import javax.xml.ws.Endpoint;

import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
import org.apache.cxf.transport.servlet.CXFNonSpringServlet;

import com.topway.ws.service.impl.HelloServiceImpl;

@SuppressWarnings("serial")
public class WebServiceNonSpringServlet extends CXFNonSpringServlet {

	@Override
	protected void loadBus(ServletConfig sc) {
		super.loadBus(sc);
		// http://127.0.0.1:8080/cxfSoap/service/helloService?wsdl
		Endpoint.publish("http://127.0.0.1:8080/cxfSoap/service/helloService", new HelloServiceImpl());
		
		// http://127.0.0.1:8080/cxfSoap/service/helloService?wsdl
		JaxWsServerFactoryBean jws = new JaxWsServerFactoryBean();

		jws.setAddress("http://127.0.0.1:8080/cxfSoap/service/helloService?wsdl");
		jws.setServiceBean(new HelloServiceImpl());
		jws.create();
	}

}
